package zysx;

import gz.*;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 18128
 * Date: 2023-09-24
 * Time: 16:06
 */
public class test {
    public static void hjx(jiekou jjj,stulist xs)
    {
        jjj.work(xs);

    }
    public static int caidan()
    {
        System.out.println("1.所有学生年龄加一");
        System.out.println("2.显示所有学生信息");
        System.out.println("3.显示年龄大于20岁的学生的信息");
        System.out.println("0.退出");
        System.out.println("请输入你的选择");
        Scanner s=new Scanner(System.in);
        return s.nextInt();
    }
    public static void main(String[] args) {
        stulist xs=new stulist();
//        hjx(new jiayi(),xs);
//        hjx(new xianshi(),xs);
//        hjx(new dayu(),xs);
          jiekou[] jjj=new jiekou[]{new tuichu(),new jiayi(),new xianshi(),new dayu()};
          while(true)
          {
              int ii=caidan();
              hjx(jjj[ii],xs);
          }


    }
}
